﻿using System;
using System.Runtime.InteropServices;

namespace WgpgCore
{
    public static class NativeMethods
    {
        [DllImport("shell32.dll", EntryPoint = "CommandLineToArgvW", CharSet = CharSet.Unicode)]
        internal static extern IntPtr _CommandLineToArgvW([MarshalAs(UnmanagedType.LPWStr)] String cmdLine, out Int32 numArgs);

        [DllImport("kernel32.dll", EntryPoint = "LocalFree", SetLastError = true)]
        internal static extern IntPtr _LocalFree(IntPtr hMem);

        [DllImport("user32.dll")]
        internal static extern Int32 GetWindowLong(IntPtr hwnd, Int32 index);

        [DllImport("user32.dll")]
        internal static extern Int32 SetWindowLong(IntPtr hwnd, Int32 index, Int32 newStyle);

        [DllImport("user32.dll")]
        internal static extern Boolean SetWindowPos(IntPtr hwnd, IntPtr hwndInsertAfter, Int32 x, Int32 y, Int32 width, Int32 height, UInt32 flags);

        [DllImport("gdi32.dll")]
        public static extern Boolean DeleteObject(IntPtr hObject);
    }
}
